curr=$(shell pwd)
.PHONY:ALL
ALL:httpserver CGI
httpserver:main.cc Protocol.cc Log.cc
	g++ -o $@ $^ -std=c++11 -lpthread

CGI:
	cd $(curr)/cgi; make; cd -

.PHONY:clean
clean:
	rm -f httpserver
	rm -rf output
	cd $(curr)/cgi; make clean; cd -
		

.PHONY:out
out:
	mkdir -p out
	cp httpserver out
	cp -rf wwwroot out
	cp ./cgi/test_cgi out/wwwroot

